var $$ = jQuery.noConflict();
(function ($, doc) {
    document.documentElement.style.fontSize = document.documentElement.clientWidth / 6.4 + 'px';
    $.init();
    tbQR()
    //淘宝二维码
    var timer;
    function tbQR() {
        var orderId = localStorage.getItem('orderId')
        $$.get("/tb/qrcode", function (e) {
            $$("p img").prop("src", "data:image/png;base64," + e.data.qrcode);
            timer = setInterval(function () {
                $$.get("/tb/checkScan?lgToken=" + e.data.lgToken + '&orderId=' + orderId, function (e) {
                    if (e.success == false) {
                        if (e.message == "二维码失效") {
                            $$(".qrErr").css("display", "block");
                            clearInterval(timer)
                        }
                    } else if (e.success == true) {
                        mui.alert("淘宝信息提交成功");
                        setTimeout(function () {
                            openPage('/wechat/tojdxx')
                        },2000)

                        clearInterval(timer)
                    }
                })
            }, 3000)
        })
    }
    //淘宝点击刷新二维码
    $(".qrErr").on("touchend", function () {
        $(".qrErr").css("display", "none");
        tbQR()
    });
})(mui, document);

